//
//  YBWithdrawTransferEarnViewController+LayoutConstraints.m
//  Nectar
//
//  Created by famer on 2023/11/11.
//  Copyright © 2023 asance. All rights reserved.
//

#import "YBWithdrawTransferEarnViewController+LayoutConstraints.h"

@implementation YBWithdrawTransferEarnViewController (LayoutConstraints)

- (void)setLayoutConstraints{
    CGFloat width = self.view.size.width;
    CGFloat height = self.view.size.height;
    CGFloat leftMargin = 12;
    CGFloat topMargin = 12;
    
    self.navigationBar.frame = CGRectMake(0,  [UIView statusBarHeight], width, 64);
    
    self.contentView.frame = CGRectMake(0,
                                        self.navigationBar.bottom,
                                        width,
                                        self.view.height-self.navigationBar.bottom);
    
    self.topContentView.frame = CGRectMake(0,
                                           1,
                                           self.contentView.width,
                                           0);
    
    CGFloat rowHeight = 56;
    CGFloat rowWidth = self.topContentView.width - leftMargin*2;
    self.amountCanBeWithdrawnRow.frame = CGRectMake(leftMargin,
                                                    topMargin,
                                                    rowWidth,
                                                    rowHeight);
    
    self.amountCanBeWithdrawnTomorrowRow.frame = CGRectMake(leftMargin,
                                                            self.amountCanBeWithdrawnRow.bottom,
                                                            rowWidth,
                                                            rowHeight);
    
    self.avaiableWithdrawalTimesRow.frame = CGRectMake(leftMargin,
                                                       self.amountCanBeWithdrawnTomorrowRow.bottom,
                                                       rowWidth,
                                                       rowHeight);
    
    self.topContentView.height = self.avaiableWithdrawalTimesRow.bottom+topMargin;
    
    ///
    self.bottomContentView.frame = CGRectMake(0,
                                              self.topContentView.bottom+topMargin,
                                              self.contentView.width,
                                              0);
    
    CGSize enterWithdrawalAmoutLabelSize = [self.enterWithdrawalAmoutLabel textBoundingSizeWithMaxSize:CGSizeMake(rowWidth, 500)];
    self.enterWithdrawalAmoutLabel.frame = CGRectMake(leftMargin,
                                                      topMargin,
                                                      rowWidth,
                                                      enterWithdrawalAmoutLabelSize.height);
    
    self.withdrawalAmoutTextField.frame = CGRectMake(leftMargin,
                                                    self.enterWithdrawalAmoutLabel.bottom+6,
                                                    rowWidth,
                                                    50);
    
    self.withdrawalButton.frame = CGRectMake(leftMargin,
                                             self.withdrawalAmoutTextField.bottom+16,
                                             rowWidth,
                                             50);
    
    CGSize withdrawalTipsLabelSize = [self.withdrawalTipsLabel textBoundingSizeWithMaxSize:CGSizeMake(rowWidth, 500)];
    self.withdrawalTipsLabel.frame = CGRectMake(leftMargin,
                                                self.withdrawalButton.bottom+26,
                                                rowWidth,
                                                withdrawalTipsLabelSize.height);
    
    self.bottomContentView.height = self.withdrawalTipsLabel.bottom+topMargin;
}


@end
